package router

import (
	"jgt-wallet/src/context"
	"jgt-wallet/src/controller/srv"

	"github.com/facebookgo/inject"
	"github.com/teambition/gear"
)

// SrvAlipayAppMap 注册路由映射
func SrvAlipayAppMap(g *inject.Graph, router *gear.Router) {
	a := new(srv.AlipayApp)
	err := g.Provide(&inject.Object{Value: a})
	if err != nil {
		panic(err)
	}
	router.Post("/alipay/app/:key/pay", context.WrapContext(a.Pay))
	router.Post("/alipay/app/:key/check", context.WrapContext(a.Check))
}
